import 'package:flutter_test/flutter_test.dart';
import 'package:firebase_plugin/firebase_plugin.dart';
import 'package:firebase_plugin/firebase_plugin_platform_interface.dart';
import 'package:firebase_plugin/firebase_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFirebasePluginPlatform
    with MockPlatformInterfaceMixin
    implements FirebasePluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FirebasePluginPlatform initialPlatform = FirebasePluginPlatform.instance;

  test('$MethodChannelFirebasePlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFirebasePlugin>());
  });

  test('getPlatformVersion', () async {
    FirebasePlugin firebasePlugin = FirebasePlugin();
    MockFirebasePluginPlatform fakePlatform = MockFirebasePluginPlatform();
    FirebasePluginPlatform.instance = fakePlatform;

    expect(await firebasePlugin.getPlatformVersion(), '42');
  });
}
